package com.example.drzhang.oengldemo.concurrent;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;

/**
 * Created by Drzhang on 2017/10/16.
 */

public class ConcurrrentTest {

    BlockingQueue<String> mStringArrayBlockingQueue = new ArrayBlockingQueue<String>(10);
    BlockingQueue<String> mStringLinkedBlockingQueue = new LinkedBlockingQueue<>();
    BlockingQueue<String> mStringPriorityBlockingQueue = new PriorityBlockingQueue<>();

    public void add(String string){
        mStringArrayBlockingQueue.add(string);
        try {
            mStringArrayBlockingQueue.put(string);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
